//
// Created by 吴锐 on 2022/2/23.
//

#include<iostream>

using namespace std;

void mySwap(int a, int b){
    int temp = a;
    a = b;
    b = temp;
}

void mySwap02(int* a, int* b){
    int temp = *a;
    *a = *b;
    *b = temp;
}

void mySwap03(int &a, int &b){
    int temp = a;
    a = b;
    b = temp;
}

int main(){

    int a = 10;
    int b = 20;

    mySwap(a, b);
    cout << "a = " << a << "\tb = " << b << endl;

    mySwap02(&a, &b);
    cout << "a = " << a << "\tb = " << b << endl;

    mySwap03(a, b);
    cout << "a = " << a << "\tb = " << b << endl;

    return 0;
}